<template>
    <div>
        <strong>登录</strong> <el-button @click="login">登录</el-button>
    </div>
</template>

<script lang="ts">

import { ElMessage } from "element-plus";
import { defineComponent, onMounted, reactive, toRefs } from "vue";


    export default defineComponent({
        setup(props) {
            //数据点
            var data = reactive({

            });

            //加载时
            onMounted(() => {
                 ElMessage({
              type: "success",
              message: "窗体正在加载中...",
            });
            });
            //方法区
            const methods= {
                login(){
                ElMessage({
              type: "error",
              message: "你点击了我...",
            });
                },
            };

            //暴露区
            return{
                ...toRefs(data),
                ...methods
            };
        }
    })
</script>